package cn.xerllent.wxtp.utils;

/**
 * 家校通讯录变更消息指令
 * @author sxh
 */
public enum SchContactEnum {

	CREATE_STUDENT("create_student", "新增学生事件"),
	UPDATE_STUDENT("update_student", "编辑学生事件"),
	DELETE_STUDENT("delete_student", "删除学生事件"),
	CREATE_PARENT("create_parent", "新增家长事件"),
	UPDATE_PARENT("update_parent", "编辑家长事件"),
	DELETE_PARENT("delete_parent", "删除家长事件"),
	SUBSCRIBE("subscribe", "家长关注事件"),
	UNSUBSCRIBE("unsubscribe", "家长取消关注事件");

    SchContactEnum(String key, String desc) {
        this.key = key;
        this.desc = desc;
    }

    public static SchContactEnum getByInstance(String key){
        for (SchContactEnum value : SchContactEnum.values()) {
            if (value.key.equalsIgnoreCase(key)){
                return value;
            }
        }
        return null;
    }

    private String key;

    private String desc;

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
